<?php
class Imagen extends Doctrine_Record {
    public function setTableDefinition() {
        $this->setTableName('imagen');
        $this->hasColumn('ruta','string',128);
        $this->hasColumn('id_publicacion','integer');
        $this->hasColumn('id_marker','integer');
        $this->hasColumn('id_cooperativa','integer');
        $this->hasColumn('id_cargador','integer');
    }

    public function setUp(){
        $this->hasOne('Publicacion as publicacion',array(
            'local'=>'id_publicacion',
            'foreign'=>'id'
        ));
        $this->hasOne('Marker as marker',array(
            'local'=>'id_marker',
            'foreign'=>'id'
        ));
        $this->hasOne('Cooperativa as cooperativa',array(
            'local'=>'id_cooperativa',
            'foreign'=>'id'
        ));
        $this->hasOne('Usuario as cargador',array(
            'local'=>'id_cargador',
            'foreign'=>'id'
        ));
    }
}
?>